package a.h;

import javax.swing.*;
import javax.swing.event.TableColumnModelListener;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;
import java.awt.*;
import java.awt.event.*;
import java.util.Enumeration;

final class ae
  extends JTable
{
  protected static final String a = "collapse";
  protected static final String b = "cycleDown";
  protected static final String c = "cycleUp";
  protected static final String d = "expand";
  private static final int e = 6;
  protected static Action f;
  protected static Action g;
  protected static Action h;
  protected static Action i;
  private final c_ j;
  
  public ae(ce paramce)
  {
    super(paramce, new e_());
    setColumnSelectionAllowed(false);
    setSelectionMode(0);
    setAutoResizeMode(3);
    setTableHeader(null);
    setShowGrid(true);
    setFocusCycleRoot(true);
    setSurrendersFocusOnKeystroke(true);
    putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
    this.j = new c_();
    addMouseListener(this.j);
    addMouseMotionListener(this.j);
    addMouseListener(new d_());
  }
  
  public Component prepareEditor(TableCellEditor paramTableCellEditor, int paramInt1, int paramInt2)
  {
    Component localComponent = super.prepareEditor(paramTableCellEditor, paramInt1, paramInt2);
    repaint(getCellRect(paramInt1, paramInt2, false));
    return localComponent;
  }
  
  protected void paintComponent(Graphics paramGraphics)
  {
    super.paintComponent(paramGraphics);
    a(paramGraphics);
  }
  
  private void a(Graphics paramGraphics)
  {
    int n = ec.t;
    boolean bool = ec.s;
    ce localce = (ce)getModel();
    int k = getRowCount();
    int m = 0;
    do
    {
      while (!bool)
      {
        if (m >= k) {
          break;
        }
        if (n == 0)
        {
          if (localce.a(m))
          {
            Rectangle localRectangle = getCellRect(m, 1, false);
            localRectangle.add(getCellRect(m, 2, false));
            if (n != 0) {
              continue;
            }
            if (paramGraphics.hitClip(localRectangle.x, localRectangle.y, localRectangle.width, localRectangle.height))
            {
              TableCellRenderer localTableCellRenderer = getCellRenderer(m, 1);
              if (n == 0) {}
              Component localComponent = localTableCellRenderer.getTableCellRendererComponent(this, getValueAt(m, 1), getSelectedRow() == m, false, m, 1);
              a(paramGraphics, localComponent, localRectangle);
            }
          }
          m++;
        }
      }
    } while (n != 0);
  }
  
  private void a(Graphics paramGraphics, Component paramComponent, Rectangle paramRectangle)
  {
    Rectangle localRectangle = paramComponent.getBounds();
    paramComponent.setBounds(paramRectangle);
    paramGraphics.translate(paramRectangle.x, paramRectangle.y);
    paramComponent.paint(paramGraphics);
    paramGraphics.translate(-paramRectangle.x, -paramRectangle.y);
    paramComponent.setBounds(localRectangle);
  }
  
  public void changeSelection(int paramInt1, int paramInt2, boolean paramBoolean1, boolean paramBoolean2)
  {
    int m = ec.t;
    if (m == 0) {
      if (this.j != null)
      {
        if (m != 0) {
          break label41;
        }
        if (this.j.a()) {
          break label57;
        }
      }
    }
    if (m == 0) {
      if (isEditing())
      {
        label41:
        if (m != 0) {
          break label59;
        }
        if (getEditingRow() != paramInt1) {
          label57:
          return;
        }
      }
    }
    label59:
    ce localce = (ce)getModel();
    if (m == 0) {}
    int k = localce.a(paramInt1) ? 0 : 2;
    super.changeSelection(paramInt1, k, paramBoolean1, paramBoolean2);
  }
  
  protected void processKeyEvent(KeyEvent paramKeyEvent)
  {
    int k = ec.t;
    if (k == 0) {
      if (this.j != null)
      {
        if (k != 0) {
          break label38;
        }
        if (this.j.a()) {
          this.j.a(false);
        }
      }
    }
    label38:
    super.processKeyEvent(paramKeyEvent);
  }
  
  public void updateUI()
  {
    super.updateUI();
    a();
  }
  
  protected void a()
  {
    InputMap localInputMap = getInputMap();
    localInputMap.put(KeyStroke.getKeyStroke(37, 0), a);
    localInputMap.put(KeyStroke.getKeyStroke(39, 0), d);
    localInputMap.put(KeyStroke.getKeyStroke(10, 0), b);
    localInputMap.put(KeyStroke.getKeyStroke(9, 0), b);
    localInputMap.put(KeyStroke.getKeyStroke(9, 1), c);
    ActionMap localActionMap = getActionMap();
    localActionMap.put(a, b());
    localActionMap.put(d, d());
    localActionMap.put(b, c());
    localActionMap.put(c, e());
  }
  
  private static Action b()
  {
    if (ec.t == 0) {
      if (f == null) {
        f = new f_(false);
      }
    }
    return f;
  }
  
  private static Action c()
  {
    if (ec.t == 0) {
      if (i == null) {
        i = new b_(false, true);
      }
    }
    return i;
  }
  
  private static Action d()
  {
    if (ec.t == 0) {
      if (g == null) {
        g = new f_(true);
      }
    }
    return g;
  }
  
  private static Action e()
  {
    if (ec.t == 0) {
      if (h == null) {
        h = new b_(true, true);
      }
    }
    return h;
  }
  
  public JToolTip createToolTip()
  {
    be localbe = new be();
    localbe.setComponent(this);
    return localbe;
  }
  
  static final class b_
    extends AbstractAction
  {
    final boolean a;
    final boolean b;
    
    public b_(boolean paramBoolean)
    {
      this(paramBoolean, false);
    }
    
    public b_(boolean paramBoolean1, boolean paramBoolean2)
    {
      this.a = paramBoolean1;
      this.b = paramBoolean2;
    }
    
    public void actionPerformed(ActionEvent paramActionEvent)
    {
      Object localObject = paramActionEvent.getSource();
      if ((localObject instanceof ae)) {
        a((ae)localObject);
      }
    }
    
    private void a(ae paramae)
    {
      int m = ec.t;
      boolean bool = ec.s;
      ce localce = (ce)paramae.getModel();
      int i = paramae.getSelectedRow();
      if (m == 0) {
        if (this.a)
        {
          j = i - 1;
          if (m == 0) {
            if (j < 0)
            {
              if (m == 0)
              {
                if (this.b) {
                  j = localce.getRowCount() - 1;
                }
              }
              else
              {
                if (m != 0) {
                  break label87;
                }
                if (!bool) {
                  break label81;
                }
              }
              return;
            }
          }
          label81:
          label87:
          if (m == 0) {}
          k = localce.a(j) ? 0 : 2;
          paramae.changeSelection(j, k, false, false);
          if (m != 0) {
            break label129;
          }
          if (!bool) {
            return;
          }
        }
      }
      int j = i + 1;
      label129:
      if (m == 0) {
        if (j > localce.getRowCount() - 1)
        {
          if (m == 0)
          {
            if (this.b) {
              j = 0;
            }
          }
          else
          {
            if (m != 0) {
              break label175;
            }
            if (!bool) {
              break label169;
            }
          }
          return;
        }
      }
      label169:
      label175:
      if (m == 0) {}
      int k = localce.a(j) ? 0 : 2;
      paramae.changeSelection(j, k, false, false);
    }
  }
  
  static final class f_
    extends AbstractAction
  {
    final boolean a;
    
    public f_(boolean paramBoolean)
    {
      this.a = paramBoolean;
    }
    
    public void actionPerformed(ActionEvent paramActionEvent)
    {
      Object localObject = paramActionEvent.getSource();
      if ((localObject instanceof ae)) {
        a((ae)localObject);
      }
    }
    
    private void a(ae paramae)
    {
      int j = ec.t;
      int i = paramae.getSelectedRow();
      if (i < 0) {
        return;
      }
      pb localpb = (pb)paramae.getValueAt(i, 0);
      if ((j != 0) || (localpb.g()))
      {
        eb localeb = (eb)localpb;
        if ((j != 0) || (localeb.m() != this.a))
        {
          localeb.a(this.a);
          ((ce)paramae.getModel()).fireTableStructureChanged();
          paramae.getSelectionModel().setSelectionInterval(i, i);
        }
      }
    }
  }
  
  static final class e_
    implements TableColumnModel
  {
    static final Object a = "toggle";
    static final Object b = "names";
    static final Object c = "values";
    final TableColumn d = new TableColumn(0);
    final TableColumn e;
    final TableColumn g;
    ListSelectionModel h;
    
    public e_()
    {
      this.d.setIdentifier(a);
      this.e = new TableColumn(1);
      this.e.setIdentifier(b);
      this.g = new TableColumn(2);
      this.g.setIdentifier(c);
      this.h = new DefaultListSelectionModel();
    }
    
    public int getColumnCount()
    {
      return 3;
    }
    
    public int getColumnMargin()
    {
      return 1;
    }
    
    public int getSelectedColumnCount()
    {
      return 0;
    }
    
    public int getTotalColumnWidth()
    {
      return this.d.getWidth() + this.e.getWidth() + this.g.getWidth();
    }
    
    public boolean getColumnSelectionAllowed()
    {
      return false;
    }
    
    public int[] getSelectedColumns()
    {
      return new int[0];
    }
    
    public int getColumnIndexAtX(int paramInt)
    {
      int m = ec.t;
      if (m == 0) {
        if (paramInt < 0) {
          return -1;
        }
      }
      int i = this.d.getWidth();
      if (m == 0) {
        if (paramInt < i) {
          return 0;
        }
      }
      int j = this.e.getWidth();
      if (m == 0) {
        if (paramInt < i + j) {
          return 1;
        }
      }
      int k = this.g.getWidth();
      if (m == 0) {
        if (paramInt < i + j + k) {
          return 2;
        }
      }
      return -1;
    }
    
    public void setColumnMargin(int paramInt) {}
    
    public void moveColumn(int paramInt1, int paramInt2) {}
    
    public void setColumnSelectionAllowed(boolean paramBoolean) {}
    
    public int getColumnIndex(Object paramObject)
    {
      int i = ec.t;
      if (i == 0) {
        if (a.equals(paramObject)) {
          return 0;
        }
      }
      if (i == 0) {
        if (b.equals(paramObject)) {
          return 1;
        }
      }
      if ((i != 0) || (c.equals(paramObject))) {
        return 2;
      }
      throw new IllegalArgumentException("Invalid column identifier: " + paramObject);
    }
    
    public Enumeration getColumns()
    {
      return new ae.0(this);
    }
    
    public ListSelectionModel getSelectionModel()
    {
      return this.h;
    }
    
    public void setSelectionModel(ListSelectionModel paramListSelectionModel) {}
    
    public void addColumnModelListener(TableColumnModelListener paramTableColumnModelListener) {}
    
    public void removeColumnModelListener(TableColumnModelListener paramTableColumnModelListener) {}
    
    public TableColumn getColumn(int paramInt)
    {
      switch (paramInt)
      {
      case 0: 
        return this.d;
      case 1: 
        return this.e;
      case 2: 
        return this.g;
      }
      throw new IllegalArgumentException("Invalid column index: " + paramInt);
    }
    
    public void addColumn(TableColumn paramTableColumn)
    {
      throw new UnsupportedOperationException();
    }
    
    public void removeColumn(TableColumn paramTableColumn)
    {
      throw new UnsupportedOperationException();
    }
  }
  
  final class c_
    extends MouseAdapter
    implements MouseMotionListener
  {
    final TableColumn a = ae.this.getColumnModel().getColumn(0);
    final TableColumn b = ae.this.getColumnModel().getColumn(1);
    final TableColumn c = ae.this.getColumnModel().getColumn(2);
    private boolean d = false;
    private boolean e = false;
    private int f = -1;
    private long g;
    
    public c_() {}
    
    public void mouseExited(MouseEvent paramMouseEvent)
    {
      if ((ec.t != 0) || (!c())) {
        a(false);
      }
    }
    
    public void mousePressed(MouseEvent paramMouseEvent)
    {
      int i = ec.t;
      if ((i != 0) || (a()))
      {
        if (i == 0)
        {
          if (!a(paramMouseEvent)) {
            return;
          }
          if (i != 0) {}
        }
        else if (!ae.this.isEditing())
        {
          if (i != 0) {
            break label56;
          }
          e();
          if (!ec.s) {
            return;
          }
        }
        label56:
        a(false);
      }
    }
    
    public void mouseReleased(MouseEvent paramMouseEvent)
    {
      if (ec.t == 0)
      {
        if (c()) {
          g();
        }
      }
      else {
        a(false);
      }
    }
    
    public void mouseDragged(MouseEvent paramMouseEvent)
    {
      int m = ec.t;
      if (m == 0) {
        if (!a())
        {
          if (m != 0) {
            break label37;
          }
          if (!c()) {
            return;
          }
        }
      }
      label37:
      int i = paramMouseEvent.getPoint().x;
      int j = Math.max(this.a.getWidth() + this.b.getMinWidth(), ae.this.getWidth() - (Math.min(100000, this.c.getMaxWidth()) + this.a.getWidth()));
      int k = Math.min(this.a.getWidth() + Math.min(100000, this.b.getMaxWidth()), ae.this.getWidth() - (this.c.getMinWidth() + this.a.getWidth()));
      if ((m != 0) || ((i >= j) && (i <= k)))
      {
        this.f = i;
        h();
      }
    }
    
    public void mouseMoved(MouseEvent paramMouseEvent)
    {
      int i = ec.t;
      if ((i != 0) || (!ae.this.isEditing())) {
        if (i != 0) {}
      }
      a(a(paramMouseEvent));
    }
    
    public boolean a()
    {
      return this.d;
    }
    
    public void a(boolean paramBoolean)
    {
      int i = ec.t;
      if (i == 0)
      {
        if (this.d == paramBoolean) {
          return;
        }
        this.d = paramBoolean;
        if (i != 0) {}
      }
      else if (this.d)
      {
        if (i != 0) {
          break label62;
        }
        ae.this.setCursor(Cursor.getPredefinedCursor(11));
        if (!ec.s) {
          return;
        }
      }
      label62:
      ae.this.setCursor(Cursor.getPredefinedCursor(0));
    }
    
    public boolean c()
    {
      return this.e;
    }
    
    public void d()
    {
      this.e = false;
      a(false);
      ae.this.repaint();
    }
    
    private void e()
    {
      this.e = true;
      this.g = System.currentTimeMillis();
    }
    
    private void g()
    {
      int i = ec.t;
      if (i == 0)
      {
        this.e = false;
        if (System.currentTimeMillis() - this.g < 400L)
        {
          if (i != 0) {
            break label43;
          }
          h();
          if (!ec.s) {
            return;
          }
        }
      }
      label43:
      d();
    }
    
    private boolean a(MouseEvent paramMouseEvent)
    {
      return a(paramMouseEvent.getPoint().x);
    }
    
    private boolean a(int paramInt)
    {
      int j = ec.t;
      int i = this.a.getWidth() + this.b.getWidth();
      if (j == 0)
      {
        if (paramInt <= i - ae.e) {
          break label46;
        }
        if (j != 0) {
          break label43;
        }
      }
      label43:
      label46:
      return paramInt < i;
    }
    
    private void h()
    {
      int k = ec.t;
      if (k == 0) {
        if (this.f >= 0)
        {
          if (k != 0) {
            break label55;
          }
          if (this.f <= ae.this.getWidth()) {
            break label44;
          }
        }
      }
      ae.this.repaint();
      return;
      label44:
      label55:
      int i = this.f - this.a.getWidth();
      int j = ae.this.getWidth() - this.f;
      synchronized (ae.this.getTreeLock())
      {
        this.b.setWidth(i);
        this.b.setPreferredWidth(i);
        this.c.setWidth(j);
        this.c.setPreferredWidth(j);
      }
      ae.this.repaint();
    }
  }
  
  final class d_
    extends MouseAdapter
  {
    final TableColumn a = ae.this.getColumnModel().getColumn(0);
    final ce c = (ce)ae.this.getModel();
    final ListSelectionModel e = ae.this.getSelectionModel();
    
    public d_() {}
    
    public void mousePressed(MouseEvent paramMouseEvent)
    {
      int j = ec.t;
      if ((j != 0) || (0 == ae.this.columnAtPoint(paramMouseEvent.getPoint())))
      {
        int i = ae.this.rowAtPoint(paramMouseEvent.getPoint());
        pb localpb = (pb)this.c.getValueAt(i, 0);
        if ((j != 0) || (localpb.g()))
        {
          eb localeb = (eb)localpb;
          if (j == 0) {}
          localeb.a(!localeb.m());
          this.c.fireTableStructureChanged();
          this.e.setSelectionInterval(i, i);
        }
      }
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.h.ae

 * JD-Core Version:    0.7.0.1

 */